<?php

use yii\db\Migration;

/**
 * Handles the creation of table `attachment`.
 */
class m170323_035435_create_attachment_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('attachment', [
            'id' => $this->primaryKey()->comment('附件序号'),
            'archive_id'=>$this->integer(11)->notNull()->unsigned()->comment('序号'),
            'type'=>$this->smallInteger()->comment('类型'),
            'description'=>$this->text()->comment('描述')
        ],'ENGINE=INNODB');
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('attachment');
    }
}
